<template>
  <div class="b-title">
    <div class="title-left">
      <div>{{ eventName }}</div>
      <div>{{ matchName }} - {{ tplTypeFilter(tplCode) }}</div>
    </div>
    <div class="title-right">
      <div>{{ formatTime(devTime) }}</div>
      <div class="title-right-logo">
        <img src="@/assets/img/obstacle.png" alt="" height="148px" />
      </div>
    </div>
  </div>
</template>

<script>
import { formatTimeFromMs } from '@/assets/utils.js'
export default {
  name: 'Title',
  props: {
    devTime: {
      type: Number,
      default: '',
    },
    eventName: {
      type: String,
      default: '',
    },
    matchName: {
      type: String,
      default: '',
    },
    tplCode: {
      type: String,
      default: '',
    },
  },
  data() {
    return {
      title: '上海久事国际马术中心',
    }
  },
  filters: {},
  mounted() {},
  methods: {
    formatTime(ms) {
      return formatTimeFromMs(ms)
    },
    tplTypeFilter(tplCode) {
      switch (tplCode) {
        case 'result':
          return '成绩公告'
        case 'order':
          return '出场顺序'
        case 'rank':
          return '成绩列表'
        case 'schedule':
          return '今日赛程'
        case 'medal':
          return '奖牌榜'
        default:
          return
      }
    },
  },
}
</script>

<style lang="less" scoped>
.b-title {
  width: 100vw;
  background-image: url('@/assets/img/top-title.png');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  height: 168px;
  // width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  // padding-left: 22%;
  color: #fff;

  .title-left {
    flex: 1;
    padding-left: 22%;
    font-size: 3.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .title-right {
    padding-right: 0.25rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-size: 4rem;
    gap: 0.25rem;

    .title-right-logo {
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }
}
</style>
